// To parse this JSON data, do
//
//     final chatQuestion = chatQuestionFromJson(jsonString);

import 'dart:convert';

ChatQuestion chatQuestionFromJson(String str) => ChatQuestion.fromJson(json.decode(str));

String chatQuestionToJson(ChatQuestion data) => json.encode(data.toJson());

class ChatQuestion {
  List<RecordModel> records;
  int? total;
  int? size;
  int? current;
  List<dynamic>? orders;
  bool? searchCount;
  int? pages;

  ChatQuestion({
    required this.records,
    this.total,
    this.size,
    this.current,
    this.orders,
    this.searchCount,
    this.pages,
  });

  factory ChatQuestion.fromJson(Map<String, dynamic> json) => ChatQuestion(
    records: json["records"] == null ? [] : List<RecordModel>.from(json["records"]!.map((x) => RecordModel.fromJson(x))),
    total: json["total"],
    size: json["size"],
    current: json["current"],
    orders: json["orders"] == null ? [] : List<dynamic>.from(json["orders"]!.map((x) => x)),
    searchCount: json["searchCount"],
    pages: json["pages"],
  );

  Map<String, dynamic> toJson() => {
    "records": List<dynamic>.from(records.map((x) => x.toJson())),
    "total": total,
    "size": size,
    "current": current,
    "orders": orders == null ? [] : List<dynamic>.from(orders!.map((x) => x)),
    "searchCount": searchCount,
    "pages": pages,
  };
}

class RecordModel {
  int? id;
  String? name;
  int? order;
  int? status;
  int? deleteFlag;
  DateTime? createTime;

  RecordModel({
    this.id,
    this.name,
    this.order,
    this.status,
    this.deleteFlag,
    this.createTime,
  });

  factory RecordModel.fromJson(Map<String, dynamic> json) => RecordModel(
    id: json["id"],
    name: json["name"],
    order: json["order"],
    status: json["status"],
    deleteFlag: json["deleteFlag"],
    createTime: json["createTime"] == null ? null : DateTime.parse(json["createTime"]),
  );

  Map<String, dynamic> toJson() => {
    "id": id,
    "name": name,
    "order": order,
    "status": status,
    "deleteFlag": deleteFlag,
    "createTime": createTime?.toIso8601String(),
  };
}
